<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

/**
 * App\WorkshopPropertyType
 *
 * @mixin \Eloquent
 * @property int $id
 * @property string|null $name 物业类型名称
 * @property int|null $sort 排序
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\WorkshopPropertyType whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\WorkshopPropertyType whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\WorkshopPropertyType whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\WorkshopPropertyType whereSort($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\WorkshopPropertyType whereUpdatedAt($value)
 */
class WorkshopPropertyType extends Model
{
    //
    protected $table="workshop_property_type";
    public static function getSelectOptions()
    {
        $options = \DB::table('workshop_property_type')->select('id','name as text')->get();
        $selectOption = [];
        foreach ($options as $option){
            $selectOption[$option->id] = $option->text;
        }
        return $selectOption;
    }
}
